using Sinacor.Infra.UI.Common;
using System.Collections.Generic;
using Sinacor.UI.Bovespa.ContaCorrente.Communication.Bovespa.ContasCorrente.ContasCorrente;

namespace Sinacor.UI.Bovespa.ContaCorrente.Communication.Translator.DataContractToModel 
{
	public class ContaCorrente 
    {
		public ContaCorrente(){}

		public ModelCollection<Model.HistoricoContaCorrente> ToHistoricoContaCorrente(List<HistoricoContaCorrenteResponse> responseList)
        {
            ModelCollection<Model.HistoricoContaCorrente> to = new ModelCollection<Sinacor.UI.Bovespa.ContaCorrente.Model.HistoricoContaCorrente>();

            foreach (HistoricoContaCorrenteResponse item in responseList)
            { 
                to.Add(ToHistoricoContaCorrente(item));
            }

            return to;
		}

		public Model.HistoricoContaCorrente ToHistoricoContaCorrente(HistoricoContaCorrenteResponse response)
        {
            Model.HistoricoContaCorrente to = new Sinacor.UI.Bovespa.ContaCorrente.Model.HistoricoContaCorrente();

            to.Codigo = response.Codigo;
            to.Descricao = response.Descricao;
            to.DiasProjecao = response.DiasProjecao;
            to.Tipo = response.Tipo;

            return to;
        }
	}
}